Skip to content

Conversation

@tonytrg
Copy link
Contributor

@tonytrg tonytrg commented Jan 13, 2026

Summary

Currently our feature flag allow toggling tools to enabled/disabled. Adding it to deps allows us to change code inside the tools. Adding hello world example to demonstrate a tool behaviour change.

Why

Fixes #

What changed

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Prompts tested (tool changes only)

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

@tonytrg tonytrg changed the title Tonytrg/add ff dep adding feature flag on dependency level Jan 14, 2026
@tonytrg tonytrg marked this pull request as ready for review January 14, 2026 10:15
@tonytrg tonytrg requested a review from a team as a code owner January 14, 2026 10:15
Copilot AI review requested due to automatic review settings January 14, 2026 10:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds feature flag support at the dependency level, enabling tools to conditionally alter their behavior based on runtime feature flags. A new IsFeatureEnabled method is added to ToolDependencies, along with a HelloWorld demonstration tool that changes its greeting based on the remote_mcp_experimental feature flag.

Changes:

  • Added IsFeatureEnabled method to ToolDependencies interface and BaseDeps implementation
  • Created HelloWorld tool demonstrating feature flag conditional behavior
  • Updated NewBaseDeps constructor to accept a featureChecker parameter
  • Added RemoteMCPExperimental feature flag constant

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/github/dependencies.go Adds IsFeatureEnabled method to interface and implementation, updates NewBaseDeps signature
pkg/github/hello.go New demonstration tool showing feature flag conditional behavior
pkg/github/hello_test.go Comprehensive tests for HelloWorld tool with feature flag scenarios
pkg/github/dependencies_test.go Tests for IsFeatureEnabled covering various edge cases
pkg/github/feature_flags.go Adds RemoteMCPExperimental constant for feature flag name
internal/ghmcp/server.go Wires feature checker into BaseDeps creation
pkg/github/server_test.go Updates stub to implement new interface method
pkg/github/dynamic_tools_test.go Updates NewBaseDeps call with nil checker

enabled, err := d.featureChecker(ctx, flagName)
if err != nil {
// Log error but don't fail the tool - treat as disabled
fmt.Fprintf(os.Stderr, "Feature flag check error for %q: %v\n", flagName, err)
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error logging uses fmt.Fprintf to os.Stderr directly instead of using the project's logging infrastructure (pkg/log). This is inconsistent with how errors are logged elsewhere in the codebase. Consider using the established logging package for consistent error handling and formatting.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants